<!DOCTYPE html>
<html>
  <head>
    <title>studentSearch.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
	<script>
		$(function(){
			function search(){
				$.get("usersearch.do",$("#f").serialize(),function(data){
				$("#student tr:gt(0)").remove();//
				var t=$("#student");
				$.each(data.list,function(i,d){
					var tr=t.find("tr:eq(0)").clone();
					for(var k in d){
						tr.find("td[field='"+k+"']").text(d[k]);
						t.append(tr);
					}
					tr.find("td:last").html("<a href=''>删除</a><a href=''>修改</a>");
				});
				
				/* data.each(function(i,d){
					t.append("<tr><td>学号</td><td>姓名</td><td>手机号</td><td>性别</td><td>操作</td></tr>");
				}); */
			});
			}
			search();
			$("#search").click(function(){
				search();
				return false;
			});
		});
		
	</script>
  </head>
  
  <body>
    <form action="studentSearchServlet" id="f">
  <input type="hidden" name="pageNo" id="pageNo" value="1"/>
   <p>
   <input type="text" placeholder="请输入姓名查询" name="name" value="">
   <input type="text" placeholder="请输入手机号查询" name="tele" value="">
   <input type="submit" value="search" id="search"/>
   </p>
  </form>
  <table id="student">
  	<tr>
    <td field="stuno">学号</td><td field="sname">姓名</td><td field="telephone">手机号</td><td field="sex">性别</td><td>操作</td>
    </tr>
  </table>
  </body>
</html>
